package com.editor.teste;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;



public class TestMotorista {
	public static void main(String[] args) {
		

		EntityManagerFactory factory = Persistence.createEntityManagerFactory("TransportePU");
		EntityManager manager = factory.createEntityManager();
		                
		EntityTransaction trx = manager.getTransaction();
		trx.begin();
		
		//Session session = manager.unwrap(Session.class);
	//	Criteria criteria = session.createCriteria(Material.class);
		
		/*
		Motorista motorista = new Motorista();
		
		motorista.setCategoria(Categoria.AB);
		motorista.setCnh("12345678945");
		motorista.setCpf("123.456.789-98");
		motorista.setDataAdmissao(new Date());
		motorista.setEmail("maleta@gmail.com");
		motorista.setNome("OI saudades");
		motorista.setTelefone("95 3298-6598");
		motorista.setDataVencimentoCnh(new Date());
		
		manager.persist(motorista);
		*/
		trx.commit();
		
		
	}
}
